Fixed an issue with queries not being properly stored as files