Some layout bug fixes