Added input check, enabled new test cases