Fixed integration problem, removed debug code