PHP5 & PSR-4 compilant changes
Optimize bad chars filtering