Bug fixes for API 27.0