Fix some issues ....

When running the script locally I ran into some issues. This fixes these problems.