Fix bug reported by @Cappadocius.