Partially revert e51ef0b. Fixed accidental commit that messed up sql inserts
Merge branch 'develop' into feature/fixmail