Fixed database context referencing