Fixed pointer type of Database::getNextHead()