Fixed small issue with label querying especially with MS SQL