Fixed a couple syntax things and variable names that could have caused problems