fixing bugs so that now py.test actually works