Fixes duplicate line and adds a new clear_profile function