Fixing some bugs at the front end