Apn bug fixes