Fixes the build in gcc 4.8.1

Workarounds for static dispatch parameter expansion in lambdas and some
weird wchar_t to char_t conversion that happens in combination with boost paths.