Error throw fixes