Bug fixes

Corrected a typo and shifted a line around to fix bugs.