Add cancan tests and fixes