mostly small bugs squashed, improved tuning curve plotting