Fix issue where for blocks nested in other types of blocks caused an exception