Fixed some annoying bugs...