fixes fragment encoding and closes #6455