Add fixes for empty messages from commit af4b6b77cf521bc659d0b23974bdd7e88e70fd98