Bugfixes: make sure variables that are used are set