Added support for weekly events, fixed some bugs