Improved performance by adding some INLINE pragmas.