Fixed CD Functions
I was using a  MSVC++ scan function instead of the stdio one. Please
merge.
Fixed infinite loop in writing of object data.
Merge pull request #522 from RobertBColton/master

Fixed CD Functions