Improved GUI layout

Also added error checking and message boxes.