Fixed checks to succeed or fail correctly.