Added more checks and corrected some spelling