Correct failing tests and add generalize helper methods