Fix bug with with record fields on the same line
Guards against possible exceptions