Fixed various comparison bugs and improved boolean parsing