Applied changes recommended by dmaxl