Added debug flag for resolve()

Includes a test to match.