Fixed a bug where plain objects in combination with sequelize.where were not converted properly to SQL. Closes #2077