Fixed other scope issues left over from JS conversion. Refs #44