Fixed flush queue
Fixed channel resubscribtion
some cleanups
indentation