Fix some bugs, mostly empty variables