More find package clean up and some code to help porting to android.