Fix js bugs

Supports opengovernment/product#95