Fix wrong variable name in generate.php, file permissions.