To fix issue #30.

Please review and comment. I also fixed get_version's format string, but I'll revert that one if you prefer to keep the patch clean.