Correcting error messages, making barrier code executable when used alone (without perl script).