Minor code cleanup

Fixed a typo and cleaned up the code