Apply fa00f5afe9 through c12d33c100 from wariocrm