[Refactor] Fix segmentation fault on test_dock.py.