Fixed index out of bounds error if remote is empty.