Fixed bugs on UI and firmware