Fixed some bugs, kept pace with changes to sonya main
Upgraded version