Added more error checking; added period to test text.