Fixed some bugs of  layouts