Code fixes to make it run