Change the emission to be more in line with stock
Fix a null pointer with detached parts
Some refactor