Adding changes to query manager. Adjusting database script.