Crazy tweaks to make RMI registry work