Fix #1248 by @Uch99