Added ping command
Fixed bug with out-of-order responses