Fixed a few issues with variables