improved key length tests