Fix resources handling.