Added Debug.type() and tests