CHG: svn sync - fixed some bugs, updated the manual, and removed warnings in clang on Mac