Fixed extract_type_from_bytes

Now works correctly for version numbers 0 and 1 at least