adds support for predefined procedures plus some fixes