Fix error when inheriting context