Fixed bug in tests