Added changes from enketo-core