Added reentrant test in main.