Many fixes and additions to the specification debugging functions