Fixed a bug with variable call before it was defied.