added tests and fixes for controller and delete cascading