Fixed bug for #40