Fixed write_cas.

Fixed reporting about the error if data is already actual
Merge pull request #64 from euroelessar/master

Fixed write_cas