Replaced the use of count, which Jena is not happy about