CRA-509 Some bug fixes