Fixed the resize function for arrays so no more bounds issues