Improvements for PHPloy v2: Two bugfixes, some tidy-up and new version number

Sorry I haven't had much time to contribute recently (work is hectic!) but thought I better submit the changes (9 commits) I had in my local copy before they get too out of date with PHPloy 3 coming. Sorry to bundle them all together.  But hoping they're still suitable for including in v2 and won't be too hard to port to v3.

Please review and let me know if anything needs changing or if anyone encounters bugs.

Simon.