Fix hang after improper input

Was waiting for a '\n' after improper input
like "hello".