Improve head tracking efficiency
Added tests for channel closing