Fixed better localport usage and removed unless crap.
More small stuff removed.