Improved stops filter and added validation code.