Added hack for numerical instability; Fixed some GUI bugs