Tests done, initialized variables and some bugfixes