minor bug fixes and comment improvements for SPARQL optimizer