changed perj.js implementation, bug: tests fail under winxp