Added some error checking and tweaked ui.