Fixing iOS menu problems and cleaning code