Corrected a few bugs!