Chipper: Fix crash for empty input buffer, rm unused var