Implement changes suggested in #327

These DB changes are required for ontologies, please review/merge ASAP