Fixed bug in script parsing withing patterns