Solve link problems and fix for #3

@christianurich you are sure this does not break all other simulations? have you tested this with some simple simulations?