fixed bugs in jpiet.