small fixes unifying error handling