Made logic for deleting resources less error prone.
Merge pull request #4 from dreisch/deleteaction

Made logic for deleting resources less error prone.