bugfixes for latest boost, compiler
merge with upstream