Clean up clang warning -Wparentheses-quality

Remove extraneous parentheses in equality comparison.
Clean up clang warning -Wdangling-else

Add some explicit braces to avoid dangling elses.
Merge pull request #8 from tbb/master

Fix some clang compiler warnings on OS X