Fix by-value self with immediates.

Fixes #5321, #4318, #4439 & #4878.