Fix a few issues

Fixed a variable naming issue that was causing the script to not execute. Also added a few formatting things.