bug 663: changed if statement and corrected typo