In the face of headwinds, the president defended many of his unpopular policies.