fixes #31 - Make DB functions stable where applicable