Changed exception to avoid unpredictable results