Backported changes from trunk to the v1.x branch.
Backported changes from trunk to the v1.x branch.

bioboy/pzs-ng,scriptzteam/pzs-ng,bioboy/pzs-ng,scriptzteam/pzs-ng,scriptzteam/pzs-ng,bioboy/pzs-ng,bioboy/pzs-ng,bioboy/pzs-ng,scriptzteam/pzs-ng,scriptzteam/pzs-ng