Fixed tests in resource-encapsulation