Fixes to make the database command system work
Some minor fixes