Replaced plain assert with assert_equal
Added output-input consistency checks