Fixed some stability bugs.