Use the correct index for unsafe-Type-key

The unsafe operation didn't return the same result as
the safe operation, meaning any checks related to type keys
were giving the wrong result. As a result, some subtyping
clauses were not triggered.
Remove some debugging code in subtype checker