Added filtering for special characters to subject, learn_period
and added a bit more error handling