Adjusted annotation and database functions to work in current
environment.