Bug fixes fore regression tests