Fixed three bugs that it sets to other value when the parameter is 0.