Updated input handling.