Fix undefined console errors. Tidy.