Some code and GUI improvements