Added better diagnostic messages