Fixed invalid trim
Removed unneeded var_dump
Made generated match functions protected