Small type safety fixes for input filtering.
Documentation for the direct script handler.