Fix permissins for generated files and other errors in Linux scripts