Various fixes for failing tests