fix typechange error (couldn't change type without an error)

add "Restrict: E"; fix minor jshint errors; use type attribute to define type