fixed a couple of bugs which broke integration tests