Fixes in monads and XML Library