Fixed some bugs in layout and input validation