Code quality:
  - remove trailing space
  - add missing ;
  - replace != by !==
  - do not define variable twice