MSVC fixes

Fixed compiler error in MSVC dealing with lambda return types (I guess
it can't deduce them?) and also signed/unsigned mismatches.