Move manager initialisation to before parsing of command arguments. Eliminates a number of nullpointerexceptions. Same bug as previous commit.