It would be helpful if you could post your exact itinerary - without that it is almost impossible for anyone to help you determine the problem, other than simply guessing - you may have too many segments in one continent, not be counting segments correctly etc. etc.
Going from NY to Casablanca, you are presumably leaving from JFK - and flying where? To MAD? What route are you taking from Barcelona to Tokyo (BCN-NRT)? I doubt there is a direct flight and I'm not sure even IB flies direct from Madrid to NRT, so you would probably have to take BA via LHR, or AY via HEL (or, it appears, JL via AMS). Without knowing what itinerary you have proposed, it's difficult to determine why it doesn't work.