Fixing mistakes as per Greg's comments