Added function to print internal errors