Fixed possible ASSERT failure