Fixed TODO_ASSERT_EQUAL and #5614 caused by bad simplification of return values.