Fixed #231
Fixed #231
Fixed #250 and Fixed #393