Properly initialize array before populating; some housekeeping