Fix the bugs in ' Merge pull request #670 from adipopescu/Flint'