fix conversion from js to prolog values