fixed pack/unpack usage, added more debug output