Fix issues with empty messages and join formatting