Fix a typo
Fix input check and separate from IO