Fixed the tablesize and made sure the bits match to properly index