Fix substring call