Fixed incorrect implementation of running a prefix scan over a table