Fixing type error in tests + complexity