Added code to auto-resolve block Id/sub ID dependency issues