Fixed some bugs and layout issues.