smurf: Allow max and min block size to specified when finding Q/U

Specified by new adam parameters maxsize and minsize
agi: Fix error context nesting bug

This caused graphics applications to fail after 256 loops.