Made code compile and run correctly

Generally a useful thing.