Fixed several sanitizing bugs