Fixing a bug in option serialization, Fixing possible NPE in outstanding value serialization, Added test cases