fix ui

Fixes #1359
And fixes other UI bugs