fixes most problems JSLint found