Fix bugs introduced by #4754
Merge pull request #4770 from svbergerem/fix-spv-4754

Fix bugs introduced by #4754