small fixes for matplotlib blocking