Test contracts and implementation of #debug