Some bug fixes to analyzer