Added assertion test to diagnose deeper errors