Fix memory leaks, add sane defaults for panel icon