fix variable and type mismatch errors
Merge pull request #3 from wingyplus/fix_type_mismatch

fix variable and type mismatch errors