FlatUI: Fixing UI integration with Flat UI

Javascript is still broken with Flat UI.