Fixed bug in generation of Named Graph elements in queries