Replace assert with exception. Will halt in release builds too, and fixes unused assignment issue
Replace assert with exception. Will halt in release builds too, and fixes unused assignment issue