minor fixes for pi