A few minor bug fixes that caused the app to crash.