Fixes some js errors