Wal-Mart agrees to safety improvements