Fix some sparql issues