Remove double assertions and dead code