Fixed some js problems up