Bugfix identified by Julian Cain.