Prevent NPE when menu == null
clean up imports