Improve BEMTREE error handling

As discussed #594
ok