Remove buggy function and debug mode