Fixed msToTimestamp to work with single-digit values.