More logic and syntax cleanup. - v. 0.50.

More logic and syntax cleanup. - v. 0.50.