FIX: changed AssertionErrors with ValueError