SFM: Fixed indexing bug