Cleaned up the tracking and trapped fluid algorithms.