Fixed some main layout problems