Mess in the PICOS conversion routines cleaned up