Improve RPATH and environment handling.