replace many lexical_cast with lexical_cast_default

This is to avoid bad_lexical_cast exception. I'm not sure if in
any cases this could actually have thrown but it's better to be
safe.