Partial revert of d9fbd270

Reverted the logic change, and updated the tests to correctly fail.
AssertionError exception should not be rethrown, has they can occur during
normal presentation compiler operation.

Fixes #1002355

(cherry picked from commit 1862714813b6b880a0612118f94f97c6a9177712)
Merge pull request #877 from skyluc/bp/issue/AssertionErrors-1002355

Backport of #876 - Partial revert of d9fbd270