Update tests
Fix a bug in debug mode