Bug fixing on layouts