Fixed some bugs in v 2.2