Fixed bugs in the databse logging system, and one preventing owned and roundtrips from refreshing. Misc improvements.