Fix initial cursor issue. Set applied library to nil if it is removed