Fixed key length bug