Add $end exception before return $bytecode;

Time: 526 ms, Memory: 25.00Mb
OK (524 tests, 530 assertions)

Change-Id: Ibe06d689361231c10913002cbbaff867b4f18123