getBytes: Better handling for strings ending with a unit.