Fixed crashing due to Object[] casting