Fixed #3283
Fixed #3258
Merge pull request #3319 from nukkumatti/issue-3258

Fixed #3258
Merge pull request #3318 from nukkumatti/issue-3283

Fixed #3283