Fixed errors with DB regarding backticks, group field names and primary

keys