More thorough unit testing and CS Fixes

This resolves #4