Fix issue with various undefined types

As shown in #809