and fixed a trivial bug