Cleaned up path generation a bit.