Fixed issue #1. It was caused by the sgn() function, which returned 0 if the input was 0. It now returns 1 if the input is 0. Also changed the FORTRAN implementation to the original one and included the necessary dependencies. The d1mach and i1mach functions are not taken from SLATEC, however; they come from Algorithm 528 by P. Fox et al. It fixes the over/underflow issues caused by the original implementations.