Fixed bug in way pipe validity is checked