Some small improvements to pixel conversion