fixed declarations for variables and fixed all broken unittests