Candidate unit tests and various bug fixes to wgsea

Various minor fixes and tests for wgsea package for consideration.