Add tests to previous bug fix