issue #1237: JavaScript exception when adding new candidate genes. 

Aww yeah fixed my first one.