Coding standards fix, and casting inputs to public methods to prevent type errors.
Added type cast for error messages as well
Merge pull request #6 from barracudanetworks/error-collection-and-logging

Standards and architecture tweaks.