extension write and minor fixes