patch for bugs, indentation also cleaned up
Merge pull request #1 from jafl/multivalue-input-patch

patch for bugs, indentation also cleaned up