Added import for ctf shared library
Fixed bug in write file