Fix tests and more variable improvement