more key length checks, docs update