Fixed bug in reading/writing extensions from CSR