Convert explicit panic() call to assert.
Based on github pull request: #113 Submitted by: pmarillo@github MFC after: 1 week