Fix building with boost version < 1.52
Fix building with gcc 4.6