Layout fix and db script fix