Added error checks because of a compiler on steroids.