Added missing code to properly support maximum file length.