correcting typesystem-related problems to make it compatible witn MPS 3.0