Fixed a few bugs

Win7