Eliminate compiler warnings; add '-Wsign-compare' for OSX

Fixes some compiler warnings, and also added `-Wsign-compare` explicitly for OS X (clang).