Fix some typing issues, thanks to Stefan's help