Changed a bit to fix issues.  Details are really in the issues in github.
fixes #70
fixes #69
fixes #68