Minor cleanup of JS