fixed bugs caused by camelcased column names and postgres migration