Fixed warnings in OSX (under clang 4.2).
Fixed warnings in Linux (under gcc 4.6)
Merge pull request #329 from xycaleth/fix-warnings

Fixed remaining compiler warnings in OSX and Linux