fixed plugin registration, improved source with JSLint