Spark Examples: Fix sparkkmeans procedure for invalid index