Fix crash caused 0-sized layout views