Fixed correct APM detection