Fix: Potential error in js (type and cmd_id must be present at all times)