JSLint compliance + few enhancements