restricted link typechecing to use exact maxpid because it is the only thing that makes sense, and other small fixes