Optimise string conversion functions a bit