Fixed implementation of basis