Fixed bugs with removing by index