Some fixes for backend functionality of messaging module