Fixed a bug, where the SQL statements were compiled before the schema was set up