Fixed SQL insert errors and updated entity classes