Menu issues - selecting [BACK] closes app

I have 3 GameObjects (‘menu screens’, as groups of text, planes and box colliders) in the same world position, which are hidden and shown as needed (switching menus). Running the code within Unity (MouseButtonDown etc) produces the desired results (click PLAY, mainMenu closes, playMenu opens, click BACK in playMenu, playMenu closes, mainMenu opens etc), but running it on my Android produces a different result. Upon touching BACK in playMenu, the app closes as if Application.Quit() was called.

edit: I should mention that the BACK and QUIT buttons are in the same position in each menu.

Raycaster() is called from Update(). These are just the offending pieces of code, this reproduces the result every time. Both the mouse and touch inputs are there so I can check things a bit quicker than building to Android after editing.

As a side note, I have had my menu working just fine in the past, however I thought of a ‘better’ way to do it, and erased the entire script. Rookie mistake, my bad. I think I once had this working with dragged variables, I’m not sure if that is extra work (for me and/or the machine).

After all that, my question is twofold:

What is going on in my code to cause this bug? and…

Is this the best way to perform the desired action?

Code: (C#)

void RayCaster() {
		if(Input.GetMouseButtonDown(0)) {
			touchRay = menuCamera.camera.ScreenPointToRay(Input.mousePosition);
			RayCastChecker();
		}
		if((Input.touchCount > 0) && (Input.GetTouch (0).phase == TouchPhase.Began)) {
			touchRay = menuCamera.camera.ScreenPointToRay(Input.mousePosition);
			RayCastChecker();
		}
	}

	void RayCastChecker() {
		if(Physics.Raycast(touchRay, out touchRayHit, 20)) {
			if(touchRayHit.collider.gameObject.name == "MainButton1") {
				mainMenu.SetActive(false);
				playMenu.SetActive (true);
			}
			if(touchRayHit.collider.gameObject.name == "PlayButton3") {
				mainMenu.SetActive(true);
				playMenu.SetActive(false);
			}
			if(touchRayHit.collider.gameObject.name == "MainButton3") {
				Application.Quit();
			}

After sleeping on it, it would appear that touches are treated as mouse clicks, so I was calling the process twice in a frame, resulting in two touches/clicks being registered before the frame could draw. Removing either input reference fixes the problem. I should have picked this up earlier (mousePosition being a major clue).