Fixed some bugs that prevented the handlers from being added