Use boost::lexical_cast instead of boost::format in some places

Fixes #41