Added more clever calcrt handling.