Slightly less broken implementation of this.