- Fixed inefficiency in capture_shape branch code