fixed pointer issues in body creation and destruction.