Fix by-value self with immediates.

Fixes #5321