Fixes a Segmentation Fault bug if size of power of 2 are used.
Fixes a Segmentation Fault bug if size of power of 2 are used.

amadvance/tommyds,jmesmon/tommyds,amadvance/tommyds,amadvance/tommyds,jmesmon/tommyds,jmesmon/tommyds,amadvance/tommyds