There are a few places where removeMenuItem() is called followed by a call to removeMenu(), but only the err from removeMenu() is called. Both err values should be checked.