Wal-Mart beats expectations as Q2 profit tops estimates