Add fixes from OldDroid