Fix input handling