Fixing padding key lengths bug