Fixed some analysis problems. Related to issue #51.