Rework to be compatible with boost 1.40