Fix some locals having the wrong type
Make regex blocks more nesting-friendly