Fixed some compilation errors in gcc (caused by missing namespace specifications and headers)