Fixed bug in basis function.