Fix javascript releated errors