Improve type knowledge.

Initialized two static fields to 0.0 (instead of the default null) and added a type check at the boundary to JS code.