Fixed failed? function and related tests