Minor errorchecking