Fixed bug with rstat packing, fixed mode bytes order,
api improoved.