Added a small unit test to catch a memory error bug.