Fixed couple error condition issues