Fixed bugs & ported to GR 3.7