fixed typo and better parens usage due to warnings from gcc"