fixed several issues in cascade support

fixed missing error handling for cascade, fixed typos in the yaml driver, fixed logic for building the bitmask


code taken from https://github.com/doctrine/phpcr-odm/pull/200