Added support for non-2**N lengths