Fixed library removal bug