Fixed bug in calculating whether event is free