Bug fixes (v0.5.2)

Fixed some bugs.