fixes #5053 - minor bug fixes to realm integration