Modify origin handling & normalization. Add tests.