Boolean type guessing added

I made a mistake with the last pull request, and it included commits that shouldn't have been there.
I closed it in order to keep things as clean as possible, this one will include only commits related to the boolean type guessing.
I'm sorry for the inconvenience.