Preventing errors if there is no $_SERVER['SCRIPT_NAME']

On some environments, when running through CLI, I've encountered cases where there is no 'SCRIPT_NAME' global set.
Adding braces around conditionals
Merge pull request #30 from weotch/patch-2

Preventing errors if there is no $_SERVER['SCRIPT_NAME']