Fixed a crash caused by autofill.

Also possibly fixed issues with screen rotation.