Fix bugs with frontend layout