fixed from/to order, debug mode