Fix routine to work on Spectrum +2A and +3.