Fix direct message related bugs