core: fix try-catch blocks processing