The U.S. government says BP has agreed to pay a record fine of more than $ 50 million for failing to correct problems at a Texas oil refinery that exploded and killed 15 workers in 2005 .