Updating bad references.

Also removing redundant code.