Fixes mongodb backend error. Closes #1303