Added exceptions to provide more information about errors. Added some debug output
Fixed merge conflicts, adapted front-end so everything compiles.