Fix for issue #194

Query optimisations