minor fixes to WPS4R script