Add regression tests for recent bug fixes