bugfixes for js kernel