Fix bug with accessing fields on polymorphic data.