Remove K&R style variable names and fix a possible NPE