Small improvements

Fixed #361
Fixed #364
Fixed #376