various teaks for better error reporting