Fixed intentionally failing temporary code while testing stuff, that was committed by accident in last commit. Also did some refactoring.