Fixes E_BAD_ACCESS-Drain error in unit test; TODO: possible memory leak?