Fix #446 proposal

@essen, what do you think of these patches?