Merge "Merging motorola's patch to fix ClassCastException" into ub-now-master