Edited error handling in generate_phrase. Negative and non int values raise an Exception.