Remove buggy functions and debug mode