fixes to reader and compiler