Fixed bugs which crept in with the variable encapsulation changes.