Corrected array bugs