Fixed unsecured shell_exec call.

Added DOM optimization.