small fixes for error cases