Fix for [PSW-177]. Adds a proper message when the file is either empty or invalid.