Fixes an issue where removing with a query object would cause an error
Merge pull request #512 from mde/fix-remove-query

Fixes an issue where removing with a query object would cause an error