fix typing errors, migrating to TS is becoming a priority, so many avoidable errors...