bug fixes and gui tidy up