Fixed some problems with portal and js libs