Fixed bug in duplicateOi
Intermediate step with gen code
Fixes for committing to DB without genkey handler