Update to API Level 20 and fix memory leak