fix log file and line getter
fix tests. restore spies after each call