Fixed some bugs
Merge branch '1.0.4b'