Fixed some bugs. Sparql tests green (except optional)
stupid merge