Fix dealocate array