Fix clear events, array to obj