Some error fixes for layouts