Add type-checks.

Index only generated when necessary after (clean).