DBA Fixes

Some query fixes and other junk, think it's all working now.