State-related obvious bug fixes. Histogram legends, etc.