Added missing indices
Allow for the case where keywords are too short