Minor fixes to make it run correctly