Fixes an error introduced by commit 45516a0c. Also, make the code more consistent across the different HS[VL] modes.