Core: simplify code
Core: rename DatabaseLocked to DatabaseLockedError
Coreaux: fix bug
TEMP
TEMP
TEMP
TEMP