check for i or j being -1, a possible return from methods i and j

Methods i and j can return -1 on lines 77 and 80, which then could be passed back to methods x and y in DensityIterator.scala lines 190 and 191, but there is no check for this.