Conforming to PSR-2 standard.

Also fixing some other minor issues discovered by code inspection.