fix typechange error (couldnt change the type); add "Restrict: E"; fix minor jshint errors; use type attribute to define type