Some fixes to make JSLint happy amongst others