Improved version checking, added self check.