Bug fixes for database and text message.