Merge Ted's previous commits