Remove debug code and trim results