Added a couple more checks.