Updated layout and fixed a few bugs.