Fix chan dispose
Only assign data pointer if not NULL
Add unit tests