fixed bugs - made tests (not all of them) working