Update 20140930A

Fixed many problems that Coverity-Scan reported