Made optional arguments operational after fixing a couple of bugs