Fix some minor issues around rebinding function references. Remove the use of  since we can simply use constructor instead.