Fixed some weird edge-case UI bugs.