warning and minor error fixed