Lots of Codex fixes