Fix to the makesingleton function.