Shortened the boilerplate a bit.
Fixed bug in $scriptPath assignment