Bit of refactoring. Added in warning about version mismatches.