Fixing array issues