Fixed bugs in input checker