Fixed a bug in new_message() function.