Fixed some issues #327.