Adjusted maximum value suitable for streaming and removed some dead code.