BZ 991121: NPE when retrieving non-existent tasks -- and other changes to catch exceptions reasonably