Added check for objective indexing

Seems to be working as intended.