Fix #279: Simplify and inline num2char