Fix bug for Sandstone pipe connecting to blocks

As described on #1193