Updated codex layout code to better handle inheritance of layout properties