merges leap fixes and removes unused code