Fixed a bug with pre and till