Top level errors behavior

In CI mode, error is printed and testing bails out immediatelly. In Dev mode, error is printed in the error pane but testing continues.

Fixed some test issues and onerror handler.