Improve BEMTREE error handling

As discussed #594
I think, it's more clean and readable without ternary operator, but as you wish.