ISO C++ fixes
Added common.cpp
Fixed compilation warnings