Fix resource indexing in views