Cleaned up duplicate code.
Made a typo somewhere.