Use type cast safe comparison

The values like true, '' or 0 could compare to lot of other stuff with
type casting.
Explicitly define radix for parseInt

This prevents unexpected behavior when parsing string like 033, which
would be treated as octal.