Ensure private functions are not exported, closes #2587