Fix cc4374a to work on all types.

Also adds some code comments
See #15