Fixed some mistakes in the bit bashing. Don't code while tired :)