Add graceful handling of empty messages