Drastically improved error handling, refactored word filtering