Add some failsafe length preconditions