Fix bugs and add unsubscribe.