Fix Issue #4, and other small problems