First autotest, fixed several errors + provided several refactorings