Bugfixes

This should fix the issue in ajax.py that was causing all the TypeError tickets. (Basically, I didn't realize there's a difference between `db.scheduler_task.id` and `db.scheduler_task.task_id`, and I by chance never managed to reproduce it on my local machine because of the low number of records.)

Also does some better handling of a few common errors that should help reduce the number of error tickets we have to monitor.