Added more autotools
Fixed seg fault on write