Fixing an error with the foreach loops in database.cpp.
Reimplementing Database::addMessage()