Significant database fixes, including adding of transactions + more