Bugs fixes + new methods in calendar and generator  + unit tests

Bugs fixes + new methods in calendar and generator classes  + unit tests