Javascript corrections