Added more locking around channels

This might help #85