Fix resources array access.