Fix a bug in chaos designer, thanks valgrind