Fixed bug in SQL query builder functionality of pipesizes model