Fixing problems that were producing errors in the JS console