added stability to more kernel functions