Fixed app merge and added extra tests.