CDEC-22: fixed UnpackCommand; added tests