Bugfixes on new setup, undefined vars