BUGFIX: set default value for "correct"
BUGFIX: swap ordering of write and chmod