Fixes issues with database resets