fixed some gcc warnings
Changed entry point for APs