Fix proc declarations not being properly handled.