Liberals and NDP team up to avoid fall election