Fixed error handling of resources.