fix loop unrolling/filtering order, and size parameter handling