Fix some built-in database methods error-checking bugs
Merge branch 'master' into namespaces