cplReadWrite improvements

Error checking improvements, fail improvements