DAR-2525 fixing bug introduced with too much JSHinting

Plus, additional, nicer errors