Fix a very nasty inheritance issue, fixes #827 (lib)