Adds support for WHILE_MAX directive

Is anything else needed?