Added define guard for ln10. Fixed some warnings.