Use same types for length and error