Fixes for singleton queries