Database communication (storing, retreiveing reports), minor bugfixes