Planetary impacts and mass changes