fix for cfg.sh from Patrick Werneck