Updated code for r19425, fixes issue #1