fixed candidate reference overwrite
simplified getFirst, most tests pass, maybe a problem in jsCore