Core/Build: Fix compile under Ubuntu 13.04 and openSUSE 12.3 (and probably other new distros)
Closes #9832
Closes #9740
Core/Misc: Remove trailing whitespace, compile warnings and minor cosmetic changes