Minor cleanup of pin reading