More diagnostic messages
Added error code for main operations