Add more robust status checks to Rake tasks