Fixed database, small changes to read/write activity