Added some checks that was causing some failures