Version regexp and ldap fixes

See CHANGES.rst for the various fixes.

This is just for review, I'll rebase it when you push v1.0.2 missing commits and tag.