Add assertion for clearer error message.