SQL/Misc: Misc fixes #2