Minor fixes for UI and some error checking