Fixes errno setting using bithacks and updates TODOs