For #3 & #6 fixed a bug with the way  resource was evaluated