Fix #1226 by @Edd-G