Made testing work. Fixed some DB stuff for testing