Fixing releasefile to release_files in query and cleaning up the query overall.