runtimes/{core,js}: various fixes (#2502)