many javascript fixes