Replace throwing if statement with assertion
Merge pull request #480 from SBoudrias/assert

Replace throwing if statement with assertion