Multiple fixes for IP3 export. Made compatible with IP4.