compilation warnings fix

Fixed the majority of compilation warnings emitted by clang (600.0.51) and gcc (4.9.1). See CHANGELOG.txt for details.