Better error checking, ugh, python..