staceys bug fixes for failing test cases