removed num.toString() casts & fixed keepNull issue