Fix regression added in 33af9eea9550a8a65ece651e5c46e8a5104a8139, fixes #1841