Automatic peak fitting works again. More bug fixes.