Fixed resource issues