Adapted patch to correct -O2 optimization in make file (-O2 exposes a bug in regex)