Added cast to the result of the block

Added cast to the result of the block to make it again the original
type (might involve generic type).
Added detection of unspecializabe code