A bunch of stuff to make gaussian drift work with bounded variables.