Fix auto layout and close the keyboard when done.