Fix for CompareStoredQueries with null values

- [x] Acceptance test
- [x] Fix implementation

This fixes #253.