ported bool and made some more fixes