Fix some JS issues for crypto js