Fixes dependency checking when casting arrays