Fix getPinMode to trim output