Cleanup whitespace, Add generic magnet handler