Fix caltrop cleanup code (closes #1)