Fixed some bugs with daggling resources