fixed some errors

errors and added test/sample file