Fixed corner cases in exp and log functions for quaternions #199