Bug fixes

Small bug fixes to processing, etc.