adding a little error checking, lowering our (at least direct) memory footprint, #27