Fix a few bugs
Merge pull request #100 from if045/KM-tech

Fix a few bugs