Fix bug reported by @lslah