added more diagnostics, fixed typos in references