Function cleanup.