Code cleanup
Change assertions to exceptions
Merge pull request #38 from fluxroot/cleanup

Code cleanup