Added functionality for debugging and added tests around verification.