Fixed a few bugs in the file here are there..