Fix parent compatibility of setCode method