some layout bug fixes