Various fixes to dataaccess