Fixed basic issues in script and added test data