Fix PIE and minor cleanup