Fixed flock script
Stdout and formatting