Fixed tests and improved setup