Fix some tests, start converting some enums to codes