Remove a lot of debug code, start looking into wrong id numbers for functions