Reimplement with enums, fix bug where getObject was used instead of getInt