javascript fixes, restriction definitions