Replaced all trigger_error by extended exceptions