Added support for programs and main blocks