clean up. fixes #1, fixes #2, fixes #4. v1.4.0