-Added bug fix and regression test