Let $f,g:\mathbb{R}\to\mathbb{R}$ denote the functions
$f(x)=\begin{cases}-x+3,&x\leq 1,\\-ax^2,&\text{otherwise}.\end{cases}$ $g(x)=\begin{cases}\frac{x^3+x^2-x-1}{x-1},&x\neq 1,\\-b,&\text{otherwise}.\end{cases}$
Determine parameters $a,b\in\mathbb{R}$ such that $f$ and $g$ are continuous.
I was thinking about comparing limits for both sides, that is finding $a$ via
$\lim\limits_{x\to 1}-x+3=\lim\limits_{x\to 1}-ax^2$
and $b=-4$ with the same approach. Actually it looked obvious to me that $a=-2$, however my thoughts don't comply with the solution of WolframAlpha. What am I doing wrong here?