Fixed "bad allocation" error in one of the unit tests