Fixed bug in write all types (-w a) mode