fixed some further bugs
fix a bunch of bugs in the new layout.