Tests bugfixing