Fixed #234 #231
Merge branch 'master' into 1.6.4