Fixed typo where registerValue was not returning the right value