Fixed a couple careless bugs