Removed dead file, some defensive programming and some minor reformatting.