Fix bug in re