Fixed bug: array elements assigned before array declared