Resolved a bug with the way items were removed from arrays