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

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