Bug fix for dealing with encapsulation.