Fixed some stability issues