Fixed #970
Fixed #945
Fixed #893