Fix fence connections
Code Cleaning