Fixes one bug with certain invalid inputs