Fix scalar inherit

This fixes the infinite recursion causing a segfault in Issue #1397