Last minute concessions mean government avoids possible defeat.