Add tests for the last couple bug fixes