Fix cleanup codes