Fixed the vaue unpack error and modified tests