See core#43 (closed) - bring the merge request over and consider @jure's comment here core!37 (closed)