improved error handling, fixed bug in subject-maps