Fixes #1226, cased by a compiler bug