Added support for internal interrupts
Minor fixes