Fixed a bunch of bugs related to handling missing events for histogram creation
Added file test_setup.py - it is not finished