Fixed some bugs
Merge branch 'work'