Electronic structure and magnetism in half-Heusler compounds