Some more errorchecking