Revert "Remove some unneeded code."

This reverts commit 5e562b40315af00c67d6175d443de68a77615832.