U.S. markets shrugged off a terror incident on Monday to close higher.