Fixed bug in script handler.