change prints to log, add overwrite option, add template mismatch warnin...

...g