Fix NPE in version macro if no qualifier is present.

Includes unit test.
Merge pull request #446 from bosschaert/version_npe_fix

Fix NPE in version macro if no qualifier is present.