Graham,
It might be a silly question, but deos the engine turned in the right side when you put it in the 917 ? If i remember well in Porsches (911, 993,996 ...) the gearbox is in front of the engine, means if you put the box back side (so the engine do a 180°) by the way you should go...